Skip to content

Fix MCP response write ordering - #2652

Merged
Widthdom merged 7 commits into
mainfrom
codex/fix-issue1927-2020-2021
May 24, 2026
Merged

Fix MCP response write ordering#2652
Widthdom merged 7 commits into
mainfrom
codex/fix-issue1927-2020-2021

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Flush MCP stdio responses explicitly before the server proceeds to subsequent input.
  • Defer response-related MCP diagnostics until after the response write attempt, including parse, oversized, auth, protocol, rate-limit, and tool-error paths.
  • Add regression coverage for response/log ordering and write-failure handling.

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release -p:UseSharedCompilation=false --filter "FullyQualifiedName~McpServerTests"
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • git diff --check
  • adversarial review: No blocking/actionable issues found.

Documentation / Changelog

  • Added changelog.d/unreleased/1927.fixed.md.
  • No README/guide changes were needed; this is an MCP transport/error-ordering fix covered by tests and changelog.

Follow-up candidates

  • Local .cdidx index recovery: cdidx reports Last batch did not complete; rerun dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll index --rebuild or a full rebuild when convenient.

Fixes #1927
Fixes #2020
Fixes #2021

@Widthdom
Widthdom marked this pull request as ready for review May 24, 2026 16:50
@Widthdom
Widthdom merged commit 1048193 into main May 24, 2026
10 checks passed
@Widthdom
Widthdom deleted the codex/fix-issue1927-2020-2021 branch May 24, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant